package com.pig4cloud.pigx.contract.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.pig4cloud.pigx.contract.annotation.SetScaleMainCurrency;
import com.pig4cloud.pigx.contract.annotation.SetScaleTokenCurrency;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 */
@Data
public class ContractPositionPageVO {

	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	/**
	 * 用户id
	 */
	private Long userId;

	/**
	 * 币对id
	 */
	private Long symbolId;

	/**
	 * 币对名称
	 */
	private String symbolName;

	/**
	 * 仓位模式（0逐仓、1全仓）
	 */
	private String mode;

	/**
	 * 方向（0做多、1做空）
	 */
	private String side;

	/**
	 * 倍数
	 */
	private Integer multiple;

	/**
	 * 当前持仓量
	 */
	@SetScaleTokenCurrency
	private BigDecimal nowNum;

	/**
	 * 开仓均价
	 */
	@SetScaleMainCurrency
	private BigDecimal openAvgPrice;

	/**
	 * 强平价
	 */
	@SetScaleMainCurrency
	private BigDecimal liquidatePrice;

	/**
	 * 手续费
	 */
	@SetScaleMainCurrency
	private BigDecimal handlingFee;

	/**
	 * 保证金
	 */
	@SetScaleMainCurrency
	private BigDecimal margin;

	/**
	 * 平仓收益率，平仓后有值
	 */
	@SetScaleMainCurrency(scale = 2)
	private BigDecimal profitRate;

	/**
	 * 未实现盈亏
	 */
	@SetScaleMainCurrency
	private BigDecimal floatProfit;

	/**
	 * 创建时间
	 */
	private LocalDateTime createTime;

}
